package jdesktop.drag;

import java.util.List;
import java.awt.*;

public class CompositeBoundsConstraint implements BoundsConstraint
{
    private List<BoundsConstraint>  constraints;

    public CompositeBoundsConstraint(List<BoundsConstraint> constraints)
    {
        this.constraints = constraints;
    }

    public void constrain(Rectangle r)
    {
        for (int i = 0; i < constraints.size(); i++)
        {
            BoundsConstraint boundsConstraint = constraints.get(i);
            boundsConstraint.constrain(r);
        }        
    }
}
